package com.sxbbc.common.core.service.impl;

import com.sxbbc.common.core.enums.ParamEnums;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sxbbc.common.core.entity.jz.InfoParam;
import com.sxbbc.common.core.mapper.jz.InfoParamMapper;
import com.sxbbc.common.core.service.IInfoParamService;

/**
 * <p>
 * 基础键值对配置表 服务实现类
 * </p>
 *
 * @author arno
 * @since 2019-03-16
 */
@Service
public class InfoParamServiceImpl extends ServiceImpl<InfoParamMapper, InfoParam> implements IInfoParamService {

	@Override
	public String getValueByCode(ParamEnums enums) {
		QueryWrapper<InfoParam> wrapper = new QueryWrapper<InfoParam>();
		wrapper.eq("kcode",enums.getKey());
		InfoParam infoParam = super.getOne(wrapper);
		if (infoParam != null) {
			return infoParam.getKvalue();
		}
		return null;
	}

}
